import request from '@/utils/request'

export function getPage(query) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card',
    method: 'post',
    data: obj
  })
}

export function delObj(id) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card',
    method: 'put',
    data: obj
  })
}

export function getDetails(id) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card/' + id,
    method: 'get'
  })
}


export function exportDetails(id) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card/export/' + id,
    method: 'get',
    responseType: 'blob'
  })
}

export function getProcess(id) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card/reportingForWork?flowCardNumber=' + id,
    method: 'get'
  })
}

export function getDataFromErp() {
  return request({
    url: '/ProductionProcesses/t-process-flow-card/getDataFromErp',
    method: 'get'
  })
}

export function getDataFromErpByMo(flowCardNumber) {
  return request({
    url: '/ProductionProcesses/t-process-flow-card/getDataFromErpByMo',
    method: 'get',
    params: { flowCardNumber },
  })
}
